//
//  DetailInfoCell.m
//  Shengzhuli
//
//  Created by FXGuo on 2018/2/7.
//  Copyright © 2018年 kamangkeji. All rights reserved.
//

#import "DetailInfoCell.h"

@interface DetailInfoCell()

@property (weak, nonatomic) IBOutlet UILabel *firstLab;
@property (weak, nonatomic) IBOutlet UILabel *secondLab;
@property (weak, nonatomic) IBOutlet UILabel *thirdLab;

@property (weak, nonatomic) IBOutlet UILabel *priceLab;
@property (weak, nonatomic) IBOutlet UILabel *nameLab;

@end

@implementation DetailInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.firstLab.layer.borderColor = RGBColor(234, 111, 90).CGColor;
    self.secondLab.layer.borderColor = RGBColor(234, 111, 90).CGColor;
    self.thirdLab.layer.borderColor = RGBColor(234, 111, 90).CGColor;
}

- (void)setModel:(SpecialModel *)model
{
    _model = model;
    self.nameLab.text = model.name;
    
    NSInteger count = [NSString stringWithFormat:@"¥%.0f",model.price].length;
    NSString *str = [NSString stringWithFormat:@"¥%.0f/人",model.price];
    NSMutableAttributedString * attrStr = [[NSMutableAttributedString alloc] initWithString:str];
    // 设置字体 设置颜色
    [attrStr addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20],NSForegroundColorAttributeName:RGBColor(234, 111, 90)} range:NSMakeRange(0, count)];
    [attrStr addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12],NSForegroundColorAttributeName:RGBColorOne(94)} range:NSMakeRange(count, attrStr.length-count)];
    self.priceLab.attributedText = attrStr;
}

- (void)setMapModel:(NewMapModel *)mapModel
{
    _mapModel = mapModel;
    self.nameLab.text = mapModel.clubName;
    self.priceLab.text = mapModel.address;
    self.priceLab.font = Font(14);
    self.priceLab.textColor = [UIColor grayColor];
}

- (IBAction)mapClick:(UIButton *)btn
{
    if (self.mapBlock) {
        self.mapBlock();
    }
}



@end
